package com.hangzhou.xyj.net.request;

import com.google.gson.Gson;
import com.google.gson.JsonObject;
import com.hangzhou.xyj.net.request.base.BaseRequest;
import com.hangzhou.xyj.utils.constants.API;

/**
 * Created by yaohuix on 2016/2/24  15:19
 * <p/>
 * 说明：我-评论 请求
 */
public class CommentReq extends BaseRequest {

    public static final int TYPE_ACTIVITY = 1;
    public static final int TYPE_DYNAMIC = 2;

    /**
     * @param type        1：活动模块(活动，热点，演出)；2：动态，音频等
     * @param userId      评论者用户的Id
     * @param commentedId 被评论对象的Id
     * @param content     评论内容
     * @return
     * @Description
     * @author yaohuix
     * @date 2016/2/24 15:20
     */
    public CommentReq(int type, int userId, int commentedId, String content) {
        JsonObject jsonObject = new JsonObject();
        jsonObject.addProperty("type", type);
        jsonObject.addProperty("userId", userId);
        jsonObject.addProperty("commentedId", commentedId);
        jsonObject.addProperty("content", content);
        String jsonStr = new Gson().toJson(jsonObject);
        add("data", jsonStr);
    }

    @Override
    public String getUrl() {
        return API.MY_COMMENT;
    }
}
